home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / doom / quake_ad.zip / HIPQW.ZIP / SRC / MISC.QC < prev    next >
Text File  |  1997-03-13  |  20KB  |  826 lines

  1.  
  2. /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
  3. Used as a positional target for spotlights, etc.
  4. */
  5. void() info_null =
  6. {
  7.     remove(self);
  8. };
  9.  
  10. /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
  11. Used as a positional target for lightning.
  12. */
  13. void() info_notnull =
  14. {
  15. };
  16.  
  17. //============================================================================
  18.  
  19. float START_OFF = 1;
  20.  
  21. void() light_use =
  22. {
  23.     if (self.spawnflags & START_OFF)
  24.     {
  25.         lightstyle(self.style, "m");
  26.         self.spawnflags = self.spawnflags - START_OFF;
  27.     }
  28.     else
  29.     {
  30.         lightstyle(self.style, "a");
  31.         self.spawnflags = self.spawnflags + START_OFF;
  32.     }
  33. };
  34.  
  35. /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  36. Non-displayed light.
  37. Default light value is 300
  38. Default style is 0
  39. If targeted, it will toggle between on or off.
  40. */
  41. void() light =
  42. {
  43.     if (!self.targetname)
  44.     {    // inert light
  45.         remove(self);
  46.         return;
  47.     }
  48.     
  49.     if (self.style >= 32)
  50.     {
  51.         self.use = light_use;
  52.         if (self.spawnflags & START_OFF)
  53.             lightstyle(self.style, "a");
  54.         else
  55.             lightstyle(self.style, "m");
  56.     }
  57. };
  58.  
  59. /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  60. Non-displayed light.
  61. Default light value is 300
  62. Default style is 0
  63. If targeted, it will toggle between on or off.
  64. Makes steady fluorescent humming sound
  65. */
  66. void() light_fluoro =
  67. {
  68.     if (self.style >= 32)
  69.     {
  70.         self.use = light_use;
  71.         if (self.spawnflags & START_OFF)
  72.             lightstyle(self.style, "a");
  73.         else
  74.             lightstyle(self.style, "m");
  75.     }
  76.     
  77.     precache_sound ("ambience/fl_hum1.wav");
  78.     ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  79. };
  80.  
  81. /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
  82. Non-displayed light.
  83. Default light value is 300
  84. Default style is 10
  85. Makes sparking, broken fluorescent sound
  86. */
  87. void() light_fluorospark =
  88. {
  89.     if (!self.style)
  90.         self.style = 10;
  91.  
  92.     precache_sound ("ambience/buzz1.wav");
  93.     ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
  94. };
  95.  
  96. /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
  97. Sphere globe light.
  98. Default light value is 300
  99. Default style is 0
  100. */
  101. void() light_globe =
  102. {
  103.     precache_model ("progs/s_light.spr");
  104.     setmodel (self, "progs/s_light.spr");
  105.     makestatic (self);
  106. };
  107.  
  108. void() FireAmbient =
  109. {
  110.     precache_sound ("ambience/fire1.wav");
  111. // attenuate fast
  112.     ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
  113. };
  114.  
  115. /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
  116. Short wall torch
  117. Default light value is 200
  118. Default style is 0
  119. */
  120. void() light_torch_small_walltorch =
  121. {
  122.     precache_model ("progs/flame.mdl");
  123.     setmodel (self, "progs/flame.mdl");
  124.     FireAmbient ();
  125.     makestatic (self);
  126. };
  127.  
  128. /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
  129. Large yellow flame ball
  130. */
  131. void() light_flame_large_yellow =
  132. {
  133.     precache_model ("progs/flame2.mdl");
  134.     setmodel (self, "progs/flame2.mdl");
  135.     self.frame = 1;
  136.     FireAmbient ();
  137.     makestatic (self);
  138. };
  139.  
  140. /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  141. Small yellow flame ball
  142. */
  143. void() light_flame_small_yellow =
  144. {
  145.     precache_model ("progs/flame2.mdl");
  146.     setmodel (self, "progs/flame2.mdl");
  147.     FireAmbient ();
  148.     makestatic (self);
  149. };
  150.  
  151. /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
  152. Small white flame ball
  153. */
  154. void() light_flame_small_white =
  155. {
  156.     precache_model ("progs/flame2.mdl");
  157.     setmodel (self, "progs/flame2.mdl");
  158.     FireAmbient ();
  159.     makestatic (self);
  160. };
  161.  
  162. //============================================================================
  163.  
  164.  
  165. /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
  166. Lava Balls
  167. */
  168.  
  169. void() fire_fly;
  170. void() fire_touch;
  171. void() misc_fireball =
  172. {
  173.     
  174.     precache_model ("progs/lavaball.mdl");
  175.     self.classname = "fireball";
  176.     self.nextthink = time + (random() * 5);
  177.     self.think = fire_fly;
  178.     if (!self.speed)
  179.         self.speed == 1000;
  180. };
  181.  
  182. void() fire_fly =
  183. {
  184. local entity    fireball;
  185.  
  186.     fireball = spawn();
  187.     fireball.solid = SOLID_TRIGGER;
  188.     fireball.movetype = MOVETYPE_TOSS;
  189.     fireball.velocity = '0 0 1000';
  190.     fireball.velocity_x = (random() * 100) - 50;
  191.     fireball.velocity_y = (random() * 100) - 50;
  192.     fireball.velocity_z = self.speed + (random() * 200);
  193.     fireball.classname = "fireball";
  194.     setmodel (fireball, "progs/lavaball.mdl");
  195.     setsize (fireball, '0 0 0', '0 0 0');
  196.     setorigin (fireball, self.origin);
  197.     fireball.nextthink = time + 5;
  198.     fireball.think = SUB_Remove;
  199.     fireball.touch = fire_touch;
  200.     
  201.     self.nextthink = time + (random() * 5) + 3;
  202.     self.think = fire_fly;
  203. };
  204.  
  205.  
  206. void() fire_touch =
  207. {
  208.     T_Damage (other, self, self, 20);
  209.     remove(self);
  210. };
  211.  
  212. //============================================================================
  213.  
  214.  
  215. void() barrel_explode =
  216. {
  217.     self.takedamage = DAMAGE_NO;
  218.     self.classname = "explo_box";
  219.     // did say self.owner
  220.     T_RadiusDamage (self, self, 160, world);
  221.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  222.     WriteByte (MSG_BROADCAST, TE_EXPLOSION);
  223.     WriteCoord (MSG_BROADCAST, self.origin_x);
  224.     WriteCoord (MSG_BROADCAST, self.origin_y);
  225.     WriteCoord (MSG_BROADCAST, self.origin_z+32);
  226.     remove (self);
  227. };
  228.  
  229.  
  230.  
  231. /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
  232. TESTING THING
  233. */
  234.  
  235. void() misc_explobox =
  236. {
  237.     local float    oldz;
  238.     
  239.     self.solid = SOLID_BBOX;
  240.     self.movetype = MOVETYPE_NONE;
  241.     precache_model ("maps/b_explob.bsp");
  242.     setmodel (self, "maps/b_explob.bsp");
  243.     setsize (self, '0 0 0', '32 32 64');
  244.     precache_sound ("weapons/r_exp3.wav");
  245.     self.health = 20;
  246.     self.th_die = barrel_explode;
  247.     self.takedamage = DAMAGE_AIM;
  248.  
  249.     self.origin_z = self.origin_z + 2;
  250.     oldz = self.origin_z;
  251.     droptofloor();
  252.     if (oldz - self.origin_z > 250)
  253.     {
  254.         dprint ("item fell out of level at ");
  255.         dprint (vtos(self.origin));
  256.         dprint ("\n");
  257.         remove(self);
  258.     }
  259. };
  260.  
  261.  
  262.  
  263.  
  264. /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
  265. Smaller exploding box, REGISTERED ONLY
  266. */
  267.  
  268. void() misc_explobox2 =
  269. {
  270.     local float    oldz;
  271.     
  272.     self.solid = SOLID_BBOX;
  273.     self.movetype = MOVETYPE_NONE;
  274.     precache_model2 ("maps/b_exbox2.bsp");
  275.     setmodel (self, "maps/b_exbox2.bsp");
  276.     setsize (self, '0 0 0', '32 32 32');
  277.     precache_sound ("weapons/r_exp3.wav");
  278.     self.health = 20;
  279.     self.th_die = barrel_explode;
  280.     self.takedamage = DAMAGE_AIM;
  281.  
  282.     self.origin_z = self.origin_z + 2;
  283.     oldz = self.origin_z;
  284.     droptofloor();
  285.     if (oldz - self.origin_z > 250)
  286.     {
  287.         dprint ("item fell out of level at ");
  288.         dprint (vtos(self.origin));
  289.         dprint ("\n");
  290.         remove(self);
  291.     }
  292. };
  293.  
  294. //============================================================================
  295. //hip
  296. //float SPAWNFLAG_SUPERSPIKE      = 1;
  297. //float SPAWNFLAG_LASER = 2;
  298. //hip
  299.  
  300. void() Laser_Touch =
  301. {
  302.     local vector org;
  303.     
  304.     if (other == self.owner)
  305.         return;        // don't explode on owner
  306.  
  307.     if (pointcontents(self.origin) == CONTENT_SKY)
  308.     {
  309.         remove(self);
  310.         return;
  311.     }
  312.     
  313.     sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC);
  314.     org = self.origin - 8*normalize(self.velocity);
  315.  
  316.     if (other.health)
  317.     {
  318.         SpawnBlood (org, 15);
  319.         T_Damage (other, self, self.owner, 15);
  320.     }
  321.     else
  322.     {
  323.         WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  324.         WriteByte (MSG_BROADCAST, TE_GUNSHOT);
  325.         WriteCoord (MSG_BROADCAST, org_x);
  326.         WriteCoord (MSG_BROADCAST, org_y);
  327.         WriteCoord (MSG_BROADCAST, org_z);
  328.     }
  329.     
  330.     remove(self);    
  331. };
  332.  
  333. void(vector org, vector vec) LaunchLaser =
  334. {
  335.     local    vector    vec;
  336.         
  337.     if (self.classname == "monster_enforcer")
  338.         sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
  339.  
  340.     vec = normalize(vec);
  341.     
  342.     newmis = spawn();
  343.     newmis.owner = self;
  344.     newmis.movetype = MOVETYPE_FLY;
  345.     newmis.solid = SOLID_BBOX;
  346.     newmis.effects = EF_DIMLIGHT;
  347.  
  348.     setmodel (newmis, "progs/laser.mdl");
  349.     setsize (newmis, '0 0 0', '0 0 0');        
  350.  
  351.     setorigin (newmis, org);
  352.  
  353.     newmis.velocity = vec * 600;
  354.     newmis.angles = vectoangles(newmis.velocity);
  355.  
  356.     newmis.nextthink = time + 5;
  357.     newmis.think = SUB_Remove;
  358.     newmis.touch = Laser_Touch;
  359. };
  360.  
  361. //hip
  362. //MED 11/09/96 added lava ball and rocket
  363. //hip
  364. void() spikeshooter_use =
  365. {
  366. //hip
  367.     local entity lavaball;
  368. //hip
  369.     if (self.spawnflags & SPAWNFLAG_LASER)
  370.     {
  371. //hip
  372.     if (!self.spawnflags & SPAWNFLAG_SILENT)
  373. //hip
  374.         sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
  375.         LaunchLaser (self.origin, self.movedir);
  376. //hip
  377.         newmis.spawnflags = self.spawnflags;
  378. //hip
  379.     }
  380. //hip
  381.    else if (self.spawnflags & SPAWNFLAG_LAVABALL)
  382.    {
  383.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  384.          sound (self, CHAN_VOICE, "misc/spike.wav", 1, ATTN_NORM);
  385.       lavaball = spawn();
  386.       lavaball.movetype = MOVETYPE_FLYMISSILE;
  387.       lavaball.solid = SOLID_BBOX;
  388.       lavaball.classname = "lavaball";
  389.       // set lavaball speed
  390.       lavaball.velocity = self.movedir * 300;
  391.       lavaball.angles = vectoangles(lavaball.velocity);
  392.       lavaball.owner = self;
  393.       lavaball.touch = T_MissileTouch;
  394.       setmodel (lavaball, "progs/lavarock.mdl");
  395.       setsize (lavaball, '-4 -4 -4', '4 4 4');
  396.       setorigin (lavaball, self.origin);
  397.       lavaball.avelocity = '0 0 400';
  398.       lavaball.nextthink = time + 5;
  399.       lavaball.think = SUB_Remove;
  400.    }
  401.    else if (self.spawnflags & SPAWNFLAG_ROCKET)
  402.    {
  403.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  404.          sound (self, CHAN_VOICE, "weapons/sgun1.wav", 1, ATTN_NORM);
  405.       W_FireRocket();
  406.       newmis.velocity = self.movedir*1000;
  407.       newmis.angles = vectoangles(newmis.velocity);
  408.       setorigin (newmis, self.origin + self.movedir*8);
  409.    }
  410. //hip
  411.     else
  412.     {
  413. //hip
  414.      if (!self.spawnflags & SPAWNFLAG_SILENT)
  415. //hip
  416.         sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
  417.         launch_spike (self.origin, self.movedir);
  418.         newmis.velocity = self.movedir * 500;
  419.         if (self.spawnflags & SPAWNFLAG_SUPERSPIKE)
  420.             newmis.touch = superspike_touch;
  421.     }
  422. };
  423.  
  424. //hip
  425. //MED 11/01/96 added state capability
  426. //hip
  427. void() shooter_think =
  428. {
  429. //hip 
  430.   if (self.state)
  431.       {
  432.       spikeshooter_use ();
  433.       }
  434.    self.nextthink = time + self.wait;
  435. //hip
  436. };
  437.  
  438.  
  439. /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
  440. When triggered, fires a spike in the direction set in QuakeEd.
  441. Laser is only for REGISTERED.
  442. */
  443.  
  444. //hip
  445. //MED 11/01/96 commented out setmovedir
  446. //hip
  447. void() trap_spikeshooter =
  448. {
  449.     SetMovedir ();
  450.     self.use = spikeshooter_use;
  451.     if (self.spawnflags & SPAWNFLAG_LASER)
  452.     {
  453.         precache_model2 ("progs/laser.mdl");
  454.         
  455.         precache_sound2 ("enforcer/enfire.wav");
  456.         precache_sound2 ("enforcer/enfstop.wav");
  457.     }
  458. //hip
  459.  else if (self.spawnflags & SPAWNFLAG_LAVABALL)
  460.    {
  461.       precache_model ("progs/lavarock.mdl");
  462. //      self.classname = "fireball";
  463.       precache_sound2 ("misc/spike.wav");
  464.    }
  465.    else if (self.spawnflags & SPAWNFLAG_ROCKET)
  466.    {
  467.       precache_model ("progs/missile.mdl");
  468.       precache_sound ("weapons/sgun1.wav");
  469.    }
  470. //hip
  471.     else
  472.         precache_sound ("weapons/spike2.wav");
  473. };
  474.  
  475.  
  476. /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent
  477. Continuously fires spikes.
  478. "wait" time between spike (1.0 default)
  479. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  480. */
  481. void() trap_shooter =
  482. {
  483.     trap_spikeshooter ();
  484.     
  485.     if (self.wait == 0)
  486.         self.wait = 1;
  487. //hip
  488. //MED 11/01/96 added state capability
  489.    self.state = 1;
  490. //hip
  491.     self.nextthink = self.nextthink + self.wait + self.ltime;
  492.     self.think = shooter_think;
  493. };
  494.  
  495. //hip
  496.  
  497. //MED 11/01/96 added new use function
  498. void() trap_shooter_use =
  499.    {
  500.    self.state = 1 - self.state;
  501.    };
  502. //MED 11/01/96 added new function
  503. /*QUAKED trap_switched_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent
  504. Continuously fires spikes.
  505. "wait" time between spike (1.0 default)
  506. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  507. "state" 0 initially off, 1 initially on. (0 default)
  508. */
  509. void() trap_switched_shooter =
  510.    {
  511.    trap_spikeshooter ();
  512.  
  513.     if (self.wait == 0)
  514.         self.wait = 1;
  515. //MED 11/01/96 added state capability
  516.     self.nextthink = self.nextthink + self.wait + self.ltime;
  517.     self.think = shooter_think;
  518.    self.use = trap_shooter_use;
  519.    };
  520. //hip
  521.  
  522. /*
  523. ===============================================================================
  524.  
  525.  
  526. ===============================================================================
  527. */
  528.  
  529.  
  530. void() make_bubbles;
  531. void() bubble_remove;
  532. void() bubble_bob;
  533.  
  534. /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
  535.  
  536. testing air bubbles
  537. */
  538.  
  539. void() air_bubbles =
  540. {
  541.     remove (self);
  542. };
  543.  
  544. void() make_bubbles =
  545. {
  546. local entity    bubble;
  547.  
  548.     bubble = spawn();
  549.     setmodel (bubble, "progs/s_bubble.spr");
  550.     setorigin (bubble, self.origin);
  551.     bubble.movetype = MOVETYPE_NOCLIP;
  552.     bubble.solid = SOLID_NOT;
  553.     bubble.velocity = '0 0 15';
  554.     bubble.nextthink = time + 0.5;
  555.     bubble.think = bubble_bob;
  556.     bubble.touch = bubble_remove;
  557.     bubble.classname = "bubble";
  558.     bubble.frame = 0;
  559.     bubble.cnt = 0;
  560.     setsize (bubble, '-8 -8 -8', '8 8 8');
  561.     self.nextthink = time + random() + 0.5;
  562.     self.think = make_bubbles;
  563. };
  564.  
  565. void() bubble_split =
  566. {
  567. local entity    bubble;
  568.     bubble = spawn();
  569.     setmodel (bubble, "progs/s_bubble.spr");
  570.     setorigin (bubble, self.origin);
  571.     bubble.movetype = MOVETYPE_NOCLIP;
  572.     bubble.solid = SOLID_NOT;
  573.     bubble.velocity = self.velocity;
  574.     bubble.nextthink = time + 0.5;
  575.     bubble.think = bubble_bob;
  576.     bubble.touch = bubble_remove;
  577.     bubble.classname = "bubble";
  578.     bubble.frame = 1;
  579.     bubble.cnt = 10;
  580.     setsize (bubble, '-8 -8 -8', '8 8 8');
  581.     self.frame = 1;
  582.     self.cnt = 10;
  583.     if (self.waterlevel != 3)
  584.         remove (self);
  585. };
  586.  
  587. void() bubble_remove =
  588. {
  589.     if (other.classname == self.classname)
  590.     {
  591. //        dprint ("bump");
  592.         return;
  593.     }
  594.     remove(self);
  595. };
  596.  
  597. void() bubble_bob =
  598. {
  599. local float        rnd1, rnd2, rnd3;
  600. local vector    vtmp1, modi;
  601.  
  602.     self.cnt = self.cnt + 1;
  603.     if (self.cnt == 4)
  604.         bubble_split();
  605.     if (self.cnt == 20)
  606.         remove(self);
  607.  
  608.     rnd1 = self.velocity_x + (-10 + (random() * 20));
  609.     rnd2 = self.velocity_y + (-10 + (random() * 20));
  610.     rnd3 = self.velocity_z + 10 + random() * 10;
  611.  
  612.     if (rnd1 > 10)
  613.         rnd1 = 5;
  614.     if (rnd1 < -10)
  615.         rnd1 = -5;
  616.         
  617.     if (rnd2 > 10)
  618.         rnd2 = 5;
  619.     if (rnd2 < -10)
  620.         rnd2 = -5;
  621.         
  622.     if (rnd3 < 10)
  623.         rnd3 = 15;
  624.     if (rnd3 > 30)
  625.         rnd3 = 25;
  626.     
  627.     self.velocity_x = rnd1;
  628.     self.velocity_y = rnd2;
  629.     self.velocity_z = rnd3;
  630.         
  631.     self.nextthink = time + 0.5;
  632.     self.think = bubble_bob;
  633. };
  634.  
  635. /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>
  636. ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/
  637.  
  638. /*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8)
  639.  
  640. Just for the debugging level.  Don't use
  641. */
  642.  
  643. void() viewthing =
  644.  
  645. {
  646.     self.movetype = MOVETYPE_NONE;
  647.     self.solid = SOLID_NOT;
  648.     precache_model ("progs/player.mdl");
  649.     setmodel (self, "progs/player.mdl");
  650. };
  651.  
  652.  
  653. /*
  654. ==============================================================================
  655.  
  656. SIMPLE BMODELS
  657.  
  658. ==============================================================================
  659. */
  660.  
  661. void() func_wall_use =
  662. {    // change to alternate textures
  663.     self.frame = 1 - self.frame;
  664. };
  665.  
  666. /*QUAKED func_wall (0 .5 .8) ?
  667. This is just a solid wall if not inhibitted
  668. */
  669. void() func_wall =
  670. {
  671.     self.angles = '0 0 0';
  672.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  673.     self.solid = SOLID_BSP;
  674.     self.use = func_wall_use;
  675.     setmodel (self, self.model);
  676. };
  677.  
  678.  
  679. /*QUAKED func_illusionary (0 .5 .8) ?
  680. A simple entity that looks solid but lets you walk through it.
  681. */
  682. void() func_illusionary =
  683.  
  684. {
  685.     self.angles = '0 0 0';
  686.     self.movetype = MOVETYPE_NONE;
  687.     self.solid = SOLID_NOT;
  688.     setmodel (self, self.model);
  689.     makestatic ();
  690. };
  691.  
  692. /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4
  693. This bmodel will appear if the episode has allready been completed, so players can't reenter it.
  694. */
  695. void() func_episodegate =
  696.  
  697. {
  698.     if (!(serverflags & self.spawnflags))
  699.         return;            // can still enter episode
  700.  
  701.     self.angles = '0 0 0';
  702.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  703.     self.solid = SOLID_BSP;
  704.     self.use = func_wall_use;
  705.     setmodel (self, self.model);
  706. };
  707.  
  708. /*QUAKED func_bossgate (0 .5 .8) ?
  709. This bmodel appears unless players have all of the episode sigils.
  710. */
  711. void() func_bossgate =
  712.  
  713. {
  714.     if ( (serverflags & 15) == 15)
  715.         return;        // all episodes completed
  716.     self.angles = '0 0 0';
  717.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  718.     self.solid = SOLID_BSP;
  719.     self.use = func_wall_use;
  720.     setmodel (self, self.model);
  721. };
  722.  
  723. //============================================================================
  724. /*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  725. */
  726. void() ambient_suck_wind =
  727. {
  728.     precache_sound ("ambience/suck1.wav");
  729.     ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
  730. };
  731.  
  732. /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  733. */
  734. void() ambient_drone =
  735. {
  736.     precache_sound ("ambience/drone6.wav");
  737.     ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
  738. };
  739.  
  740. /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  741. */
  742. void() ambient_flouro_buzz =
  743. {
  744.     precache_sound ("ambience/buzz1.wav");
  745.     ambientsound (self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC);
  746. };
  747. /*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  748. */
  749. void() ambient_drip =
  750. {
  751.     precache_sound ("ambience/drip1.wav");
  752.     ambientsound (self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC);
  753. };
  754. /*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  755. */
  756. void() ambient_comp_hum =
  757. {
  758.     precache_sound ("ambience/comp1.wav");
  759.     ambientsound (self.origin, "ambience/comp1.wav", 1, ATTN_STATIC);
  760. };
  761. /*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  762. */
  763. void() ambient_thunder =
  764. {
  765.     precache_sound ("ambience/thunder1.wav");
  766.     ambientsound (self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC);
  767. };
  768. /*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  769. */
  770. void() ambient_light_buzz =
  771. {
  772.     precache_sound ("ambience/fl_hum1.wav");
  773.     ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  774. };
  775. /*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  776. */
  777. void() ambient_swamp1 =
  778. {
  779.     precache_sound ("ambience/swamp1.wav");
  780.     ambientsound (self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC);
  781. };
  782. /*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  783. */
  784. void() ambient_swamp2 =
  785. {
  786.     precache_sound ("ambience/swamp2.wav");
  787.     ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
  788. };
  789.  
  790. //============================================================================
  791.  
  792. void() noise_think =
  793. {
  794.     self.nextthink = time + 0.5;
  795.     sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
  796.     sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
  797.     sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
  798.     sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
  799.     sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
  800.     sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
  801.     sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
  802. };
  803.  
  804. /*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10)
  805.  
  806. For optimzation testing, starts a lot of sounds.
  807. */
  808.  
  809. void() misc_noisemaker =
  810.  
  811. {
  812.     precache_sound2 ("enforcer/enfire.wav");
  813.     precache_sound2 ("enforcer/enfstop.wav");
  814.     precache_sound2 ("enforcer/sight1.wav");
  815.     precache_sound2 ("enforcer/sight2.wav");
  816.     precache_sound2 ("enforcer/sight3.wav");
  817.     precache_sound2 ("enforcer/sight4.wav");
  818.     precache_sound2 ("enforcer/pain1.wav");
  819.     precache_sound2 ("enforcer/pain2.wav");
  820.     precache_sound2 ("enforcer/death1.wav");
  821.     precache_sound2 ("enforcer/idle1.wav");
  822.  
  823.     self.nextthink = time + 0.1 + random();
  824.     self.think = noise_think;
  825. };
  826.